#include "GlobalFunctions.h"

bool GlobalFunctions::debugMode = true;

GlobalFunctions::GlobalFunctions(){
	SetDebugMode(true);
}
GlobalFunctions::~GlobalFunctions(){}
void GlobalFunctions::PreOnFrameUpdate(){


	LibraryInterface::PreOnFrameUpdate();
}
unsigned int GlobalFunctions::PostOnFrameUpdate(){
	LibraryInterface::PostOnFrameUpdate();
	return 0;
}
void GlobalFunctions::SetDebugMode(bool mode){
	debugMode = mode;
}
bool GlobalFunctions::DebugModeEnabled(){
	return debugMode;
}
bool GlobalFunctions::Initialize(){
	bool spinup_okay = LibraryInterface::Initialize();
	SetDebugMode(true);
	return spinup_okay;
}
bool GlobalFunctions::Deinitialize(){
	bool spindown_okay = LibraryInterface::Deinitialize();
	
	//delete all timers
	Timer* timer;
	for(unsigned int i = 0 ; i < Timer::GetTimerListSize(); i++){
		timer = Timer::GetTimer(i);
		timer->Deinitialize();		
	}
	Timer::UpdateAllTimers();
	
	//delete all entities here
	
	return spindown_okay;
}
Timer* GlobalFunctions::FactoryTimer(){
	return Timer::FactoryTimer();
}
Timer* GlobalFunctions::GetTimer(unsigned int timer_number){
	return Timer::GetTimer(timer_number);
}
